sysroot: Move ostree_sysroot_origin_new_from_refspec here
authorColin Walters <walters@verbum.org>
Thu, 3 Oct 2013 22:32:41 +0000 (18:32 -0400)
committerColin Walters <walters@verbum.org>
Thu, 3 Oct 2013 22:34:24 +0000 (18:34 -0400)
Rather than having it live in admin.  This is useful for other
consumers like the test suite.

src/libostree/ostree-sysroot.c
src/libostree/ostree-sysroot.h
src/ostree/ot-admin-builtin-deploy.c
src/ostree/ot-admin-functions.c
src/ostree/ot-admin-functions.h

index 4839118b03980b88ba7b7719d4000e4d9d0dc472..f61324af6b6060abe6ff808df9205aa1d642d8da 100644 (file)
@@ -1095,3 +1095,18 @@ ostree_sysroot_get_merge_deployment (OstreeSysroot     *self,
   return NULL;
 }
 
+/**
+ * ostree_sysroot_origin_new_from_refspec:
+ * @refspec: A refspec
+ *
+ * Returns: (transfer full): A new config file which sets @refspec as an origin
+ */
+GKeyFile *
+ostree_sysroot_origin_new_from_refspec (OstreeSysroot  *sysroot,
+                                        const char     *refspec)
+{
+  GKeyFile *ret = g_key_file_new ();
+  g_key_file_set_string (ret, "origin", "refspec", refspec);
+  return ret;
+}
+
index a61f491d1a34a69259a5ccc339b23c918f9db090..5bed119289c72e3952ce70281a27af3edc86de9a 100644 (file)
@@ -84,5 +84,9 @@ gboolean ostree_sysroot_deploy_one_tree (OstreeSysroot     *self,
 OstreeDeployment *ostree_sysroot_get_merge_deployment (OstreeSysroot     *self,
                                                        const char        *osname);
 
+
+GKeyFile *ostree_sysroot_origin_new_from_refspec (OstreeSysroot      *self,
+                                                  const char         *refspec);
+
 G_END_DECLS
 
index 5e94e90924be4dc40e8b3cc5eef5d76377cc996b..54e34856a860b7200c3c7fcf2acfc489e2b20787 100644 (file)
@@ -97,7 +97,7 @@ ot_admin_builtin_deploy (int argc, char **argv, OstreeSysroot *sysroot, GCancell
     }
   else
     {
-      origin = ot_origin_new_from_refspec (refspec);
+      origin = ostree_sysroot_origin_new_from_refspec (sysroot, refspec);
     }
 
   if (!ostree_repo_resolve_rev (repo, refspec, FALSE, &revision, error))
index 3ca7508c0811cd37ed800de4df74a4111f26b103..fe5c3f99b11548f3201ccbe006e17ea0d2121b8c 100644 (file)
 #include "ostree.h"
 #include "libgsystem.h"
 
-GKeyFile *
-ot_origin_new_from_refspec (const char *refspec)
-{
-  GKeyFile *ret = g_key_file_new ();
-  g_key_file_set_string (ret, "origin", "refspec", refspec);
-  return ret;
-}
-
 gboolean
 ot_admin_require_booted_deployment_or_osname (OstreeSysroot       *sysroot,
                                               const char          *osname,
index e0a824d2e98a96286bbd5919ad86053010ec1903..1b26948d0de9612ee782952891a8bd5cc3d595c2 100644 (file)
@@ -27,8 +27,6 @@
 
 G_BEGIN_DECLS
 
-GKeyFile *ot_origin_new_from_refspec (const char *refspec);
-
 gboolean
 ot_admin_require_booted_deployment_or_osname (OstreeSysroot       *sysroot,
                                               const char          *osname,